<template>
  <div class="order">
    <div class="headerhh">
      <div @click="goBack" style="float: left">
        <a-icon type="left" class="icon" />
        <a class="h3">疼痛等级调查</a>
      </div>
    </div>
    <div class="contents">
      <div class="header">尊敬的患者您好，您的疼痛评估结果为：</div>
      <div class="bodys">
        <div class="left">
          <img src="../../../static/images/pain/body.png"/>
        </div>
        <div class="right">
          <div>
            <span class="pain-left">疼痛部位：{{personalInfo.pain_area}}</span>
          </div>
          <div class="pain-nature">
            <span class="pain-left">疼痛性质：{{personalInfo.pain_nature}}</span>
          </div>
          <div class="pain-nature">
            <span class="pain-left">疼痛程度：{{personalInfo.level}}</span>
          </div>
          <div class="pain-nature">
            <span class="pain-left">评估时间：{{personalInfo.createTime}}</span>
          </div>
        </div>
      </div>
      <div class="footer">
        <button class="nextStep" @click="goIndex">重新评估</button>
      </div>
    </div>
  </div>
</template>

<script>
import moment from 'moment'
import urls from '../../common.js'
// import $ from 'jquery'
export default {
  name: 'index',
  data () {
    return {
      pa_id: this.$store.state.personinfo.pa_id, // pa_id
      data: [],
      showDown: false, // 下拉框
      showflag: false, // 弹出层选择时间
      downdata: [],
      startTime: '', // 开始时间
      endTime: '', // 结束时间
      personalInfo: ''
    }
  },
  created () {
    this.postQuerySignByPaId() // 根据paid查询接口
  },
  methods: {
    moment,
    goIndex () {
      this.$router.push('/painSurvey')
    },
    goBack () {
      this.$router.push('/')
    },
    postQuerySignByPaId () {
      this.$http
        .get(urls.findLevelByPaidAndInTime + '?paId=' + this.$store.state.personinfo.pa_id +
             '&inTime=' + this.$store.state.personinfo.in_time)
        .then(result => {
          if (result.body.code === '200') {
            this.personalInfo = result.body.data[0]
          }
        })
    },
    handleSubmit (event) { // 点击请选择时
      event.preventDefault()
      this.showDown = !this.showDown
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '../../../static/css/color.styl';

  .pain-right{
    flex:1;
    text-align:right;
    color: gray;
  }

  .pain-left{
    font-size:0.3rem;
  }

.pain-nature{
  margin-top:0.8rem;
}

.footer{
  text-align:right;
  padding-right:0.3rem;
  button{
    width: 1.5rem;
    height: 0.6rem;
    border-radius: 0.1rem;
    background: #fff;
    border: 1px solid #27ae9e;
    color:#27ae9e;
  }
  .nextStep{
    color:#fff;
    background:#27ae9e;
    margin-left: 0.2rem;
  }
}

.order{
  height:100%;
  background:#f7f8fa;
  display: flex;
  flex-flow: column;
  .contents{
    height: 100%;
    margin: 0.3rem;
    background:#fff;
    .header{
      font-size:0.24rem;
      margin: 0.6rem 0 0 0.3rem;
      span{
        color:#a3e1da;
      }
    }
    .bodys{
      display: flex;
      .left{
        width:7rem;
        text-align: right;
        img{
          height: 7rem;
          margin-top: 0.5rem;
        }
      }
      .right{
        flex:1;
        padding:1rem 0 0 2rem;
      }
    }
    .left{
      // background-image url('../../../static/images/pain/body.png')
    }
  }
}

.headerhh {
  height: 0.98rem;
  background-color: $color-main;
  text-align: justify;
  line-height: 0.98rem;
  padding-left: 0.3rem;
  color: $color-white;
  // margin-bottom: 0.5rem;

  .icon {
    font-size: 0.36rem;
    color: $color-white;
    vertical-align: -0.07rem;
  }

  .h3 {
    display: inline-block;
    font-size: 0.36rem;
    color: $color-white;
  }
}

.screen {
  position: relative;
  width: 14.36rem;
  height: 0.8rem;
  line-height: 0.8rem;
  display: flex;
  justify-content: space-around;
  margin: auto;
  margin-bottom: 0.5rem;

  .comm-screen {
    height: 100%;
    background-color: #fff;
    border-radius: 0.2rem;
    box-shadow: #ccc 0px 1px 1px -1px; // 底部阴影
    padding: 0 0.3rem;

    span {
      &:nth-of-type(1) {
        color: $color-main;
      }

      &:nth-of-type(2) {
        color: $color-gray;
      }
    }

    #select {
      display: inline-block;
      width: 4rem;
      text-align: right;
    }
  }

  .screen-left {
    width: 7.7rem;
  }

  .screen-right {
    width: 6.4rem;
  }

  .pull-down {
    width: 6.4rem;
    height: 3rem;
    background-color: rgba(255, 255, 255, 0.7);
    position: absolute;
    top: 0.9rem;
    right: 0.1rem;
    border-radius: 0.2rem;
    box-shadow: #ccc 0px 1px 1px -1px;
    padding: 0 0.3rem;

    .pull-ul {
      width: 6.1rem;
      height: 3rem;
      max-height: 3rem;
      overflow-y: auto;

      li {
        font-size: 0.28rem;
        color: #1a1a1a;
        height: 0.6rem;
      }
    }
  }
}

.sign-content {
  width: 14.36rem;
  height: 6.44rem;
  display: flex;
  justify-content: space-around;
  margin: auto;
  flex-wrap: wrap;

  .sign-base {
    width: 6.96rem;
    height: 3.03rem;
    border-radius: 0.2rem;
    padding: 0.3rem;
  }

  .sign-one {
    background-image: url('../../../static/images/sign/signOne.png');
  }

  .sign-two {
    background-image: url('../../../static/images/sign/signTwo.png');
  }

  .sign-three {
    background-image: url('../../../static/images/sign/signOne.png');
  }

  .sign-four {
    background-image: url('../../../static/images/sign/signThree.png');
  }

  .animalheat {
    height: 0.3rem;
    border-left: 4px solid #fff;
    padding: 0 0.15rem 0 0.15rem;
    display: flex;
    justify-content: space-between;

    p {
      font-size: 0.3rem;
      color: #fff;
    }
  }

  .particulars {
    font-size: 1.2rem;
    text-align: center;
    color: #fff;
    line-height: 2.5rem;
  }

  .shrink {
    width: 3.9rem;
    height: 1.35rem;
    display: flex;
    justify-content: space-around;
    margin: 0.56rem auto;
    text-align: center;

    p {
      color: #fff;

      &:nth-of-type(1) {
        font-size: 0.3rem;
        margin-bottom: 0.4rem;
      }

      &:nth-of-type(2) {
        font-size: 0.8rem;
      }
    }
  }
}

.ant-dropdown {
  position: relative;

  ul {
    position: absolute;
    right: -0.28rem;
    top: 0.3rem;
    width: 6.4rem;
    height: 1.6rem;
    border-radius: 0.2rem;
  }
}

.ant-dropdown-link {
  color: $color-gray;
}

.ant-dropdown-menu-item {
  font-size: 0.28rem;
  color: #1a1a1a;
}

.v-enter {
  opacity: 0;
  transform: translateY(-20px);
}

.v-leave-to {
  opacity: 0;
  transform: translateY(20px);
}

.v-enter-active, .v-leave-active {
  transition: all 0.4s ease;
}

.layder {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;

  .lay-cont {
    width: 4rem;
    height: 2.3rem;
    background-color: rgba(0, 0, 0, 0.6);
    margin: 4.8rem auto;
    border-radius: 0.3rem;
    color: #fff;
    text-align: center;
    padding-top: 0.4rem;
    font-size: 0.32rem;

    .stateimg {
      width: 0.78rem;
      height: 0.78rem;
      margin: 0 auto 0.4rem auto;

      img {
        width: 100%;
        height: 100%;
        display: block;
      }
    }
  }
}

.showload {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;

  .showbox {
    width: 4rem;
    height: 2.3rem;
    // background-color: rgba(0, 0, 0,0.5);
    // background-color: #fafafa;
    margin: 3.6rem auto;
    border-radius: 0.3rem;
    color: #fff;
    text-align: center;
    font-size: 0.32rem;

    .showimg {
      // width: 0.8rem;
      // height: 0.8rem;
      // width: 100%;
      height: 100%;
      display: inline-block;
      // margin-top: 0.7rem;
    }
  }
}
</style>
